package models

import (
	"tuowei.com/cmd/migrate/migration/models"
	common "tuowei.com/common/models"
)

type SysScore struct {
	Id           int     `json:"id" gorm:"primaryKey;autoIncrement;comment:"id"` // id
	BuyerId      int     `comment:"买家id" json:"buyer_id"`                        //买家id
	OrderNumber  string  `gorm:"type:varchar(64);not null;default:'';index;comment:订单编号" json:"order_number"`
	ScoreChange  float64 `gorm:"type:decimal(10,2);comment:积分变动" json:"score_change"`
	Change       int     `gorm:"type:int(10);not null;default:1;index;comment:1积分收入或者支出" json:"change"`
	ScoreSum     float64 `gorm:"type:decimal(10,2);comment:本次变动后的积分总额" json:"score_sum"`
	OrderType    string  `gorm:"type:varchar(64);comment:商品类型OnlineOrder，MaterialOrder,LiveOrder" json:"order_type"`
	Subject      string  `gorm:"type:varchar(64);comment:科目" json:"subject"`
	Name         string  `gorm:"type:varchar(64);comment:课程名称" json:"name"`
	Cover        string  `gorm:"type:varchar(500);comment:封面" json:"cover"`
	Introduction string  `gorm:"type:varchar(500);comment:课程简介" json:"introduction"`
	common.ControlBy
	models.ModelTime
}

func (SysScore) TableName() string {
	return "sys_score"
}

func (e *SysScore) Generate() common.ActiveRecord {
	o := *e
	return &o
}

func (e *SysScore) GetId() interface{} {
	return e.Id
}
